package cn.algorithm;

/**
 * @author: lizemin
 * @version: 1.0
 */
public class Test05 {
    //这是一个main方法,是程序的入口
    public static void main(String[] args) {


    }
    // 5 * 4 * 3 * 2 * 1 = 120
    public static int factorial(int num){
        if (num == 1){
            return 1;
        }else {
            return num * factorial(num - 1);

        }

    }

}
